package com.demo.blog;

import com.jfinal.core.Controller;
import com.jfinal.core.Path;

import lombok.extern.slf4j.Slf4j;

/**
 * @author create by ping-e-lee on 2021年7月12日 下午8:19:13 
 * @version 1.0 
 * @desc
 */
@Path("log")
@Slf4j
public class LogController extends Controller {
  public void whatIsLog() {
    //org.slf4j.helpers.NOPLogger
    renderText(log.getClass().getName());
  }
  
  public void exception() {
    log.info("exception");
    try {
      throw new IllegalArgumentException("This is a test");
    } catch (Exception e) {
      e.printStackTrace();
      log.error(e.getMessage());
    }
    renderText("ok");
  }
}
